﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CastingWellEquipmentGUI.View.Pages.SettingMenuPages
{
    /// <summary>
    /// ControlTagSettingPage.xaml 的交互逻辑
    /// </summary>
    public partial class ControlTagSettingPage : Page
    {
        public ControlTagSettingPage()
        {
            InitializeComponent();
        }
        public static ControlTagSettingPage instance;

        public static ControlTagSettingPage Instance
        {
            get
            {
                if (instance == null)
                {
                    Console.WriteLine("new Page1.................");
                    instance = new ControlTagSettingPage();
                }

                return instance;
            }
        }

        private void DataGrid_AutoGeneratingColumn(object sender, DataGridAutoGeneratingColumnEventArgs e)
        {
            if (e.Column.Header.ToString() == "OrderNo" ||
                e.Column.Header.ToString() == "FormId" ||
                e.Column.Header.ToString() == "FormExplain" ||
                e.Column.Header.ToString() == "ControlId" ||
                e.Column.Header.ToString() == "ControlExplain" ||
                e.Column.Header.ToString() == "TagID" ||
                e.Column.Header.ToString() == "TagName" ||
                e.Column.Header.ToString() == "Address" ||
                e.Column.Header.ToString() == "PlcModelName" ||
                e.Column.Header.ToString() == "DataType" ||
                e.Column.Header.ToString() == "BrandName"
               )
            {
                e.Cancel = true;
            }
        }
    }
}
